package com.ying.po.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel("快递信息")
@Entity
@Table(name = "t_express")
@DynamicInsert
@DynamicUpdate
public class Express implements Serializable {

    @ApiModelProperty(value = "主键", example = "1")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @ApiModelProperty(value = "快递名称")
    @Column(name = "name")
    private String name;

    @ApiModelProperty(value = "出发地")
    @Column(name = "origin")
    private String origin;

    @ApiModelProperty(value = "目的地")
    @Column(name = "target")
    private String target;

    @ApiModelProperty(value = "重量")
    @Column(name = "weight")
    private Integer weight;

    @ApiModelProperty(value = "价格")
    @Column(name = "price")
    private BigDecimal price;

    @ApiModelProperty(value = "某个月份的价格")
    @Column(name = "date")
    @JsonFormat(pattern = "yyyy")
    private Date date;

    @ApiModelProperty(value = "是否删除")
    @Column(name = "is_delete")
    private Integer isDelete;

    @ApiModelProperty(value = "系统用户ID")
    @Column(name = "user_id")
    private Integer userId;

    public Integer getUserId() {
        return userId;
    }

    public void setUserID(Integer userId) {
        this.userId = userId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "Express{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", origin='" + origin + '\'' +
                ", target='" + target + '\'' +
                ", weight=" + weight +
                ", price=" + price +
                ", date=" + date +
                ", isDelete=" + isDelete +
                ", userID=" + userId +
                '}';
    }
}
